package cn.chinaunicom.kafka.controller;

import cn.chinaunicom.kafka.producer.ProductKafka;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xuwenyuan
 * @date 2020/2/16 15:23
 * @description
 */
@RequestMapping("/kafka")
@RestController
public class ProducerController {

    @Autowired
    private ProductKafka productKafka;

    @RequestMapping(value = "/product/{what}",method = RequestMethod.GET)
    public String sendFoo(@PathVariable String what) {
        productKafka.send("mysons",what);
        return "消息发送成功";
    }

}

